/* 
 * GrayRabbit Cms基于J2EE架构内容管理系统
 * Copyright © GrayRabbit Co., Ltd. All rights reserved.
 * Department：运营部
 * 更多信息，请visit:
 * http://code.google.com/p/gray-rabbit-cms/
 */
package org.grayrabbit.cms.dao.topic; 

import java.util.List;

import org.grayrabbit.cms.entity.Topic;
import org.grayrabbit.cms.vo.topic.TopicBean;

import org.grayrabbit.dao.GenericDao;
import org.grayrabbit.dao.util.Page;
import org.grayrabbit.dao.util.QueryCondition;

/**
 * <b>Topic</b>的DAO接口

 * @version 1.0,创建时间:2011-05-16 15:59:25 
 */
public interface TopicDao extends GenericDao<Topic, String>{
	
	/**
	 * 根据bean组装查询条件
	 */
	public QueryCondition assembly(TopicBean bean);
	/**
	 * 根据bean组装统计查询条件
	 */
	public QueryCondition assemblyCount(TopicBean bean);
	public int count(TopicBean bean);
	/**
	 * 根据bean组装查询条件(名称参数)
	 */
	public QueryCondition assermblyNameQuery(TopicBean bean);
	
	/**
	 * 根据bean组装统计查询条件(名称参数)
	 */
	public QueryCondition assemblyNameQueryCount(TopicBean bean);
	/**
	 * 填充分页组件
	 * @param page
	 * @param bean
	 */
	public List<Topic> findByPage(Page<Topic> page, TopicBean bean);
	
	public List<Topic> findBySiteId(String siteId);
	
	public List<Topic> findPublishBySiteId(String siteId,int currentTopicListIndex,int max);
	
	/**
	 * 检查同一站点下专题名称唯一性
	 * @param role
	 * @return
	 */
	public Boolean checkNameUnique(String topicName,String tname,String siteId);
	/*
	 * 专题简称唯一验证
	 */
	public Boolean checkSimplenameunique(String simName, String siteId,String oldSimpleName);
	
	public List<Topic> ftlFindTopics(String[] siteIds, String[] topicIds,
			long[] limit);
	
	

}